<template>
  <div class="app-container table-app-container">
    <el-row>
      <el-col v-for="(item,index) in list" :key="index" :span="4">
        <div @click="jump(item)">
          <el-card class="box-card">
            <el-row style="ali">
              <el-col :span="24">
                <i style="font-size:80px" class="el-icon-copy-document" />
              </el-col>
              <el-col :span="24">
                <span style="font-size:20px">{{ item.name }}</span>
              </el-col>
            </el-row>
          </el-card>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>

import { getRouter, list } from '@neu/dcam-ui/api/businessProcess'
export default {
  name: 'MyProcess',
  data() {
    return {
      list: []
    }
  },
  created() {
    list({ s_auth: true }).then(res => {
      this.list = res.data
      console.log(this.list)
    })
  },
  methods: {
    // 跳转到对应的路由
    jump(item) {
      getRouter(item.code).then(res => {
        const data = res.data
        if (data) {
          this.$router.push({ name: data.routerName, params: { processDefinitionId: item.code }})
        }
      })
    }
  }
}
</script>
